<template>
  <common-page title="基础信息">
    <LayoutPart :partTitle="'基础信息'">
      <avue-form :option="baseOption" v-model="baseForm"></avue-form>
    </LayoutPart>
    <LayoutPart :partTitle="'授权列表'">
      <avue-crud
        ref="crud"
        class="crud-table"
        :option="tableOption"
        :data="data"
        :header-cell-class-name="() => 'crud-table-head'"
        :cell-class-name="() => 'crud-cell'"
      >
      </avue-crud>
    </LayoutPart>
  </common-page>
</template>
<script>
import { baseOption, tableOption } from './index.option'
import { getLoginTenant } from '@/api/user'
export default {
  name: 'baseinfo',
  data() {
    return {
      baseForm: {},
      data: []
    }
  },
  computed: {
    baseOption() {
      return baseOption.call(this)
    },
    tableOption() {
      return tableOption.call(this)
    }
  },
  mounted() {
    this.init()
  },
  methods: {
    async init() {
      const { result } = await getLoginTenant()
      this.baseForm = { ...result, subDomain: result.subDomain + 'msa.ixunhang.com' }
      this.data = result.shipList
    },
    back() {}
  }
}
</script>
